Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common power-libperfmgr bringup #1

Open
wants to merge 6 commits into
base: fourteen-v3
Choose a base branch
from

Conversation

rayavanindra
Copy link

@rayavanindra rayavanindra commented Jul 21, 2024

Summary by CodeRabbit

  • New Features
    • Introduced a standardized code formatting configuration to improve code quality and collaboration.
    • Added a performance management framework to optimize system performance through performance locking and feedback mechanisms.
    • New build configuration for the libqti-perfd-client library within the Android ecosystem.

These changes collectively enhance the maintainability and performance optimization of the project.

Lucchetto and others added 6 commits July 20, 2024 23:44
* proprietary perfd blobs can finally be nuked without breaking goodix
* we could even map the functions to use libperfmgr powerhints in the future

[SebaUbuntu]: Cleanup Android.bp and add copyright header

Change-Id: I124652f3041761966a3e3bd97c757fecc39cc5fb
It's pointless when using extern "C".

Change-Id: Ibdf9f06a70aa3a75687b33781c78cf2172bb334d
Return a positive integer for perf lock acquire and release so
that Goodix/FPC fingerprint sensor blobs will not complain.

Goodix:
E [goodixHAL][gf_hal_milan_f_series]: goodix_perf_lock_acquire: Failed to acquire perf lock, err: 0
E [goodixHAL][gf_hal_milan_f_series]: goodix_perf_lock_release: Perf lock release error 0

FPC:
E fpc_tac : fpc_perf_lock_acquire: Incorrect params, Failed to acquire perf lock, err
E fpc_tac : fpc_perf_lock_release: Perf lock release error 0

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I861672e9a738c2204755d802670f4b28b662f286
* Why bothering with C++ mangling when we can just build it as a standard C library?

Change-Id: I45ea977edf7ea7fab6fece76f3049654a8d24c5d
This avoids conflicts with QCOM devices that are using the QTI perf
implementation, which wouldn't want this library anyway as this one is
a stub.

Change-Id: I6258b7503bc45b8dced2022e6ff143fbe97e7c82
* Add and run clang-format
* Add newlines between functions
* Use elvis operator `?:` for return value

Change-Id: I920044df12c99d32ddd2ef3fb5edf24bcd0c7360
Copy link

coderabbitai bot commented Jul 21, 2024

Walkthrough

The recent changes introduce new files to the libqti-perfd-client module, including configuration for code formatting and build definitions. Additionally, a new source file implements functions for performance locking and feedback, establishing a framework for optimizing system performance. These updates enhance code consistency, build processes, and performance management within the project, promoting better collaboration and efficiency among developers.

Changes

Files Change Summary
libqti-perfd-client/.clang-format New file added to standardize code formatting across the project.
libqti-perfd-client/Android.bp New file defining build configuration for a shared C library using Soong, specifying dependencies.
libqti-perfd-client/client.c New file implementing performance locking functions, providing a framework for managing system performance.

Poem

🐇 In code we hop and play around,
With formats neat, our joy is found.
New functions sing, locks in a dance,
Performance blooms, give it a chance!
Together we code, in harmony's tune,
Under bright stars, we’ll leap to the moon! 🌙✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Outside diff range, codebase verification and nitpick comments (4)
libqti-perfd-client/client.c (4)

12-12: Placeholder function: perf_get_feedback.

The function is currently empty and might be a placeholder for future implementation.

Consider adding a comment to indicate that this function is intentionally left empty.


14-14: Placeholder function: perf_hint.

The function is currently empty and might be a placeholder for future implementation.

Consider adding a comment to indicate that this function is intentionally left empty.


22-22: Placeholder function: perf_lock_cmd.

The function is currently empty and might be a placeholder for future implementation.

Consider adding a comment to indicate that this function is intentionally left empty.


29-29: Placeholder function: perf_lock_use_profile.

The function is currently empty and might be a placeholder for future implementation.

Consider adding a comment to indicate that this function is intentionally left empty.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4b7858b and 23cd78f.

Files selected for processing (3)
  • libqti-perfd-client/.clang-format (1 hunks)
  • libqti-perfd-client/Android.bp (1 hunks)
  • libqti-perfd-client/client.c (1 hunks)
Files skipped from review due to trivial changes (2)
  • libqti-perfd-client/.clang-format
  • libqti-perfd-client/Android.bp
Additional comments not posted (1)
libqti-perfd-client/client.c (1)

1-11: LGTM! Header and includes are correct.

The copyright notice and SPDX license identifier are appropriate. The included headers are necessary for logging and standard integer types.

Comment on lines +24 to +26
int perf_lock_rel(int handle) {
ALOGI("perf_lock_rel: handle: %d", handle);
return handle ?: 233;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential portability issue with GCC extension.

The use of the ?: ternary operator is a GCC extension and may not be portable. Consider using a standard ternary operator for better portability.

-    return handle ?: 233;
+    return handle ? handle : 233;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
int perf_lock_rel(int handle) {
ALOGI("perf_lock_rel: handle: %d", handle);
return handle ?: 233;
int perf_lock_rel(int handle) {
ALOGI("perf_lock_rel: handle: %d", handle);
return handle ? handle : 233;

Comment on lines +16 to +20
int perf_lock_acq(int handle, int duration, int arg3[], int arg4) {
ALOGI("perf_lock_acq: handle: %d, duration: %d, arg3[0]: %d, arg4: %d", handle, duration,
arg3[0], arg4);
return handle ?: 233;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential portability issue with GCC extension.

The use of the ?: ternary operator is a GCC extension and may not be portable. Consider using a standard ternary operator for better portability.

-    return handle ?: 233;
+    return handle ? handle : 233;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
int perf_lock_acq(int handle, int duration, int arg3[], int arg4) {
ALOGI("perf_lock_acq: handle: %d, duration: %d, arg3[0]: %d, arg4: %d", handle, duration,
arg3[0], arg4);
return handle ?: 233;
}
int perf_lock_acq(int handle, int duration, int arg3[], int arg4) {
ALOGI("perf_lock_acq: handle: %d, duration: %d, arg3[0]: %d, arg4: %d", handle, duration,
arg3[0], arg4);
return handle ? handle : 233;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants